#ifndef LOGICLOGIC_H
#define LOGICLOGIC_H

#include "LogicPool/LogicPool.h"

class LogicLogic : public LogicPool
{
  protected:

    uint8_t mode;
  
  public:
  
    static const int MODE_OR         = 0;
    static const int MODE_AND        = 1;
    static const int MODE_XOR        = 2;
    static const int MODE_RSFF       = 3;
    static const int MODE_SFF        = 4;
    static const int MODE_DFF        = 5;
    static const int MODE_DIFF       = 6;
    static const int MODE_DIFF_ASYNC = 7;
    static const int MODE_SYNC       = 8;
    static const int MODE_SYNC_ASYNC = 9;

    LogicLogic(LogicInterface & iinterface, uint8_t number = 1) 
        : LogicPool(iinterface, 'L', number), mode(0) {};

    void SetMode(uint8_t imode) {
        SetAddress(2);
        logicpool.WriteByte(mode = imode);
    };

    void SetFF() {
        SetAddress(3);
        logicpool.WriteByte(0xff);
    };

    void ResetFF() {
        SetAddress(3);
        logicpool.WriteByte(0);
    };
};

#endif

